<%--
  Created by IntelliJ IDEA.
  User: w1057229265
  Date: 2021/5/31
  Time: 16:10
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<script>
    if ('edit' == '<%=request.getParameter("action")%>') {
        console.log("edit......")
        let row = $('#dg').datagrid('getSelected');
        $.ajax({
            type: "GET",
            url: "/ServletSupplier?action=getone",
            data: {supplierno: row.supplierno},
            success: function (ret) {
                let result = eval("(" + ret + ")");
                console.log(result.data);
                if (result.code == "200") {
                    $('#supplierno').textbox({
                        readonly:true,
                        required:true,
                        validType:''
                    })
                    $('#ff').form('load', result.data);
                } else {
                    // $.messager.alert('My Title','Here is a info message!','info');
                    alert(result.msg)
                }
            }
        })
    };
</script>
<form id="ff" method="post" style="padding: 5px;">
    <div style="margin-bottom:10px">
        <input class="easyui-textbox" id="supplierno" name="supplierno" style="width:90%" data-options="label:'供应商编码:',required:true,
        validType:{
		remote:['/ServletSupplier?action=exists','supplierno']},invalidMessage:'供应商编码已经存在'">
    </div>
    <div style="margin-bottom:10px">
        <input class="easyui-textbox" id="suppliername" name="suppliername" style="width:90%" data-options="label:'供应商名称:',required:true">
    </div>
    <div style="margin-bottom:10px">
        <input class="easyui-textbox" id="address" name="address" style="width:90%" data-options="label:'地址:'">
    </div>
    <div style="margin-bottom:10px">
        <input class="easyui-textbox" id="contacts" name="contacts" style="width:90%" data-options="label:'联系人:'">
    </div>
    <div style="margin-bottom:10px">
        <input class="easyui-textbox" id="telephone" name="telephone" style="width:90%" data-options="label:'联系人电话::'">
    </div>
</form>

